package com.njdj.gps.kernel.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.njdj.gps.kernel.service.impl.BaseServiceImpl;
import com.njdj.gps.kernel.dao.IGpsCarHisDao;
import com.njdj.gps.kernel.dao.ISeTaskDao;
import com.njdj.gps.kernel.entity.GpsCarHis;
import com.njdj.gps.kernel.entity.SeTask;
import com.njdj.gps.kernel.service.ICreateIdService;
import com.njdj.gps.kernel.service.IGpsCarHisService;

/**
 * @Description:实现类
 * @author harry
 * @version 1.0
 */
public class GpsCarHisServiceImpl extends BaseServiceImpl<GpsCarHis,IGpsCarHisDao> implements IGpsCarHisService {
	
	@Autowired
	ISeTaskDao seTaskDao;
	@Autowired
	ICreateIdService createIdService;
	@Autowired
	IGpsCarHisDao gpsCarHisDao;
	public void saveQueryCarHis(SeTask seTask, List<GpsCarHis> gpsCarHisList) {
		seTaskDao.insert(seTask);
		if(null != gpsCarHisList){
			for(GpsCarHis gpsCarHis : gpsCarHisList){
				gpsCarHis.setId(createIdService.getId());
				gpsCarHis.setTaskid(seTask.getId());
				gpsCarHis.setCreatetime(new Date());
				gpsCarHisDao.insert(gpsCarHis);
			}
		}
	}
	public List<GpsCarHis> listCarHis(Map<String, Object> param) {
		return this.getBaseDao().gpsCarHisList(param);
	}
 
}
